<?  
    if(!file_exists("images")){     //看是否存在文件夹images
        mkdir("images");
    }
    $path = $_FILES['img']['tmp_name'];
    move_uploaded_file($path,"images/".$_FILES['img']['name']);
    $arr = $_POST ; 
    $arr['img'] = $_FILES['img']['name'] ; 
    echo json_encode($arr);
?>